<template>
	<view class="page">
		<!-- <view class="wxtip" v-if="isShowShadow">
			<view class="wxtip-txt">
				<image class="wxtip-icon" src="/static/weixin_tip.png" mode="widthFix"></image>
				<image class="wxtip-icon" :src='STATIC_URL+"98.png"' mode="widthFix"></image>
			</view>
		</view> -->
		<view class="bottom flex justify-center">
			<view class="btn flex justify-center align-center" style="margin-right: 13rpx" @click="downApp">
				<!-- <image src="../static/apple.png" style="width: 26rpx; height: 32rpx; margin-right: 16rpx" mode=""> -->
				<image src='/static/images/ios.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx" mode="">
				</image>
				iPhone下载
			</view>
			<view class="btn flex justify-center align-center" style="margin-left: 13rpx" @click="downAnd">
				<image src='/static/images/Android.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx"
					mode="">
				</image>
				Android下载
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// isShowShadow: false,
				// schemeUrl: "juzhongde://",
				// pagePath: "",
				dataMessage: {},
			};
		},
		onLoad(options) {
			//如果在微信中打开
			// let ua = navigator.userAgent;
			// let isWeixin = !!/MicroMessenger/i.test(ua);
			// if (isWeixin) {
			// 	this.isShowShadow = true;
			// }
			this.queryEssayFunc();
		},
		methods: {
			//
			async queryEssayFunc() {
				//请求方法
				//数据验证
				let datadataMessage = await this.$api.get(global.apiUrls.post6717463928b84);
				if (datadataMessage.data.code != 1) {
					this.$message.info(datadataMessage.data.msg);
					return;
				}
				let infodataMessage = datadataMessage.data;
				this.dataMessage = infodataMessage.data;
				console.log(this.dataMessage);
			},
			// 打开/下载App
			downApp() {
				if (!this.dataMessage.ios_urls) {
					uni.showToast({
						icon: "none",
						title: "暂无链接",
					});
					return;
				} else {
					location.href = this.dataMessage.ios_urls;
				}
				// var ua = window.navigator.userAgent.toLowerCase();
				// if (ua.match(/MicroMessenger/i) == "micromessenger") {
				// 	this.$message.info("请在浏览器中打开");
				// } else {
				// 	location.href = this.dataMessage.ios_urls;
				// }
			},
			downAnd() {
				if (!this.dataMessage.android_urls) {
					uni.showToast({
						icon: "none",
						title: "暂无链接",
					});
					return;
				} else {
					location.href = this.dataMessage.android_urls;
				}
				// var ua = window.navigator.userAgent.toLowerCase();
				// if (ua.match(/MicroMessenger/i) == "micromessenger") {
				// 	this.$message.info("请在浏览器中打开");
				// } else {
				// 	location.href = this.dataMessage.android_urls;
				// }
			},
		},
	};
</script>

<style lang="scss" scoped>
	.page {
		height: calc(100vh - 88rpx - var(--status-bar-height));
		// width: 750rpx;
		background: url("https://adminwy.gaozhengwuyou.com/fenxiang.png");
		background-size: 100% 100%;
		background-repeat: no-repeat;
		position: relative;
		height: 100vh;
	}

	.bottom {
		// width: 750rpx;
		width: 100%;
		position: absolute;
		bottom: 260rpx;


		.btn {
			// width: 40%;
			padding: 0 20px 0 20px;
			height: 72rpx;
			background-color: #d90b20;
			color: #fff;
			border-radius: 36rpx;
			font-size: 14px;
		}
	}
</style>